<template>
	<view class="content padding ffffff">
		<view class="flexbetween margin_bottom5" @click="goAccountSafe">
			<view class="text_g color_ling">
				账户安全
			</view>
			<u-icon name="arrow-right" color="rgba(175, 175, 175, 1)" size="12"></u-icon>
		</view>
		<view class="flexbetween margin_bottom5" @click="goTakeAddress">
			<view class="text_g color_ling">
				我的地址
			</view>
			<u-icon name="arrow-right" color="rgba(175, 175, 175, 1)" size="12"></u-icon>
		</view>
		<view class="flexbetween margin_bottom5" @click="goFeedBack">
			<view class="text_g color_ling">
				意见反馈
			</view>
			<u-icon name="arrow-right" color="rgba(175, 175, 175, 1)" size="12"></u-icon>
		</view>
		<view class="flexbetween margin_bottom5" @click="toyonghuxy">
			<view class="text_g color_ling">
				用户协议
			</view>
			<u-icon name="arrow-right" color="rgba(175, 175, 175, 1)" size="12"></u-icon>
		</view>
		
		<view class="flexbetween margin_bottom5" @click="toyinsi">
			<view class="text_g color_ling">
				隐私政策
			</view>
			<u-icon name="arrow-right" color="rgba(175, 175, 175, 1)" size="12"></u-icon>
		</view>
		
		
		
		
		<view class="flexbetween margin_bottom5" @click="goAboutWe">
			<view class="text_g color_ling">
				关于我们
			</view>
			<u-icon name="arrow-right" color="rgba(175, 175, 175, 1)" size="12"></u-icon>
		</view>
		<view class="flexbetween margin_bottom5" @click="goAboutWe">
			<view class="text_g color_ling">
				版本号
			</view>
			<view class="text_g color_jiu margin_right1">{{appVersion}}</view>
		</view>
		<!-- 底部 -->
		<view class="footer ffffff padding">
			<view class="footerButton" @click="loshow=true">退出登录</view>
		</view>
		<u-modal :show="loshow" title="确定退出登录吗？" :showCancelButton="true" confirmColor="#ff740e" @cancel="loshow=false"
			@confirm="outLogin"></u-modal>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data(){
			return {
				loshow:false,
				appVersion:""
			}
		},
		onLoad() {
			let res=uni.getSystemInfoSync()
			this.appVersion=res.appVersion
			console.log(res.appVersion);
		},
		methods:{
			//跳转用户协议
			toyonghuxy() {
				uni.navigateTo({
					url: '/pages_mine/aboutWe?type=2'
				})
			},
			//跳转隐私政策
			toyinsi() {
				uni.navigateTo({
					url: '/pages_mine/aboutWe?type=3'
				})
			},
			outLogin(){
				let _this = this
				httpRequest.request('/api/user/logout', 'POST', {
					
				}).then(res => {
					if(res.code==1){
						uni.removeStorageSync('token');
						uni.removeStorageSync('user_id');
						httpRequest.toast("退出登录成功！")
						this.$store.commit('INITIALIZATION_LIST')
						// this.$store.commit('onSocketClose')
						this.loshow=false
						setTimeout(()=>{
							uni.navigateBack(1)
						},500)
					}
				})
				// uni.removeStorageSync('token');
				// uni.removeStorageSync('user_id');
				// httpRequest.toast("退出登录成功！")
				// // httpRequest.request("/api/user/logout","POST",{}).then(res=>{})
				// this.$store.commit('onSocketClose')
				// this.loshow=false
				// setTimeout(()=>{
				// 	uni.navigateBack(1)
				// },500)
			},
			goAccountSafe(){ //账户安全
				uni.navigateTo({
					url:"./accountSafe"
				})
			},
			goTakeAddress(){ //收货地址
				uni.navigateTo({
					url:"./takeAddress"
				})
			},
			goFeedBack(){ //意见反馈
				uni.navigateTo({
					url:"./feedBack"
				})
			},
			goAboutWe(){ //关于我们
				uni.navigateTo({
					url:"/pages_mine/aboutWe?type=1"
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
</style>